package cn.yangliu.poi.view;

import cn.yangliu.poi.tools.ExportUtils;
import org.apache.poi.hssf.usermodel.*;
import org.springframework.web.servlet.view.document.AbstractExcelView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 通用excel模版
 */
@Deprecated
public class SimpleExcelView extends AbstractExcelView implements ExportUtils {
    private LinkedHashMap<String,String> mapping;

    /**
     *
     * @param mapping LinkedHashMap<标题,属性>
     */
    public SimpleExcelView(LinkedHashMap<String,String> mapping){
        this.mapping=mapping;
    }

    @SuppressWarnings("unchecked")
    @Override
    protected void buildExcelDocument(Map<String, Object> model,
                                      HSSFWorkbook workbook, HttpServletRequest request,
                                      HttpServletResponse response) {
        buildExcelDocument(model,workbook,request,response,mapping);
    }


}
